package cn.leyou;

import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @version 1.0.0
 * @Author yong.Mr
 * @data 2019-8-9
 */
/*@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker*/ // 开启熔断机制
@SpringCloudApplication // 组合注解, 相当于@SpringBootApplication,@EnableDiscoveryClient,@EnableCircuitBreaker
@EnableFeignClients // 启用feign组件
public class ConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerApplication.class, args);
    }

    @Bean
    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }
}
